package com.example.demo.controller;
import com.example.demo.entity.Finance;
import com.example.demo.service.FinanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;

@RestController
@RequestMapping("/api/finance")
@CrossOrigin(origins = "*")
public class FinanceController {

    @Autowired
    private FinanceService financeService;

    // 查询所有城市信息
    @GetMapping
    public List<Finance> getAllFinance() {
        return financeService.getAllFinance();
    }

    // 根据城市编号查询城市信息
    @GetMapping("/payrollmonth/{payrollmonth}")
    public Finance getFinanceBypayrollmonth(@PathVariable String payrollmonth) {
        return financeService.getFinanceBypayrollmonth(payrollmonth);
    }

}
